﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Plant.aspx.cs" Inherits="PPAP.Web.Supplier.Plant" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body style="font-family: Arial, Helvetica, sans-serif; overflow-x: hidden;" >
    <form id="form1" runat="server">
    <div>
        <table width="100%" style="display: none;">
            <tr>
                <td>
                    Supplier Code
                </td>
                <td>
                    <asp:TextBox ID="txtSupplierNo" runat="server" Enabled="False"></asp:TextBox><font
                        color='red'>*</font>
                </td>
                <td>
                    Plant Name
                </td>
                <td>
                    <asp:TextBox ID="txtPlantName" runat="server"></asp:TextBox><font color='red'>*</font>
                </td>
            </tr>
            <tr>
                <td>
                    Plant Code
                </td>
                <td>
                    <asp:TextBox ID="txtPlantCode" runat="server"></asp:TextBox><font color='red'>*</font>
                </td>
                <td>
                    Telephone
                </td>
                <td>
                    <asp:TextBox ID="txtTelephone" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Main business
                </td>
                <td>
                    <asp:TextBox ID="txtMainBusiness" runat="server"></asp:TextBox>
                </td>
                <td>
                    Address
                </td>
                <td>
                    <asp:TextBox ID="txtAddress" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td colspan="4" align="right">
                    <asp:Button ID="Button1" runat="server" Text="Add" OnClick="Button1_Click" CssClass="button"
                        OnClientClick="return confirm('Are you sure you want to save?');" />
                </td>
            </tr>
        </table>
        <table width="100%">
            <tr>
                <td align="right">
                    <input value="Add" onclick="javascript:add();" class="button" type="button" />
                </td>
            </tr>
        </table>
        <asp:GridView ID="GridView1" runat="server" CellPadding="4" Width="100%" ForeColor="#333333"
            GridLines="None" AutoGenerateColumns="False">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:TemplateField HeaderText="SN" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("rownum") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:TemplateField>
                 <asp:TemplateField HeaderText="Supplier code" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Eval("suppliercode") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:TemplateField>
                 <asp:TemplateField HeaderText="Supplier name" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Eval("suppliername") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Plant name" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Eval("PLANTNAME") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Main business" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:Label ID="Label4" runat="server" Text='<%# Eval("MAINBUSINESS") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Address" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:Label ID="Label5" runat="server" Text='<%# Eval("ADDRESS") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Telephone" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Eval("TELEPHONE") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Plant code" Visible="false" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Eval("PLANTCODE") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:TemplateField>
                <asp:HyperLinkField DataNavigateUrlFields="ID" Visible="false" DataNavigateUrlFormatString="Plant.aspx?PID={0}"
                    Text="Edit" />
               <asp:TemplateField HeaderText="User" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <img src="../Images/newimg/write.png" title="User" onclick="<%#"javascript:editcp("+Eval("ID")+");" %>" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Edit" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <img src="../Images/newimg/write.png" title="Edit" onclick="<%#"javascript:edit("+Eval("ID")+");" %>" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Delete" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" Visible="false" runat="server" OnClientClick="return confirm('Please confirm to delete the file.')"
                            PostBackUrl='<%# "Users.aspx?deid="+Eval("ID") %>'>Delete</asp:LinkButton>
                        <img src="../Images/newimg/delete.png" title="Delete" onclick="<%#"javascript:del("+Eval("ID")+")" %>" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EditRowStyle BackColor="#2461BF" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#E7E8E8" Font-Bold="True" Font-Size="12px" ForeColor="Black" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F5F7FB" />
            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
            <SortedDescendingCellStyle BackColor="#E9EBEF" />
            <SortedDescendingHeaderStyle BackColor="#4870BE" />
        </asp:GridView>
    </div>
    </form>
</body>
<script language="javascript">
    function del(id) {
        if (confirm('Please confirm to delete the plant.')) {
            url = "Plant.aspx?deid=" + id;
            window.location.href = url;
        }

    }
    function edit(id) {
        url = "PlantEdit.aspx?PID=" + id;
        PopUpWindow(url, 330, 160, 530, 350);
        //        window.location.href = url;
    }
    function editcp(id) {
        url = "ContrctPerson.aspx?PID=" + id;
        PopUpWindow(url, 230, 80, 820, 520);
//        window.location.href = url;
    }
    function add() {
        url = "PlantEdit.aspx";
        PopUpWindow(url, 330, 160, 530, 350);
    }
</script>
</html>
